package com.example.demo.service.impl;

import com.example.demo.entity.preinspectionmanage;
import com.example.demo.mapper.preinspectionmanageMapper;
import com.example.demo.service.PreinspectionmanageService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PreinspectionmanageServiceImpl implements PreinspectionmanageService {
    @Resource
    private preinspectionmanageMapper preinspectionmanageMapper;

    @Override
    public String insert(@RequestBody preinspectionmanage preinspectionmanage)//插入预防性检修信息
    {
        if (preinspectionmanageMapper.insert(preinspectionmanage)==1)
            return "插入成功";
        else return "插入失败";
    }

    @Override
    public List query()
    {
        return preinspectionmanageMapper.query();
    }//查询信息

    @Override
    public String update(@RequestBody preinspectionmanage preinspectionmanage)//更新预防性检修信息
    {
        if (preinspectionmanageMapper.update(preinspectionmanage)==1)
            return "更新成功";
        else return "更新失败";
    }

}
